#include <bits/stdc++.h>

#define ll long long
#define ull unsigned long long
#define uint unsigned int

#define YES cout << "YES" << '\n'
#define NO cout << "NO" << '\n'
#define endl '\n'
const int INF = 1e9;
const int MOD = 998244353;
using namespace std;

/*思考
贪心：直接删掉剩两个且必须为倒序（排序后不一一对应✅）
*/

void solve() {
    int n;
    cin >> n;
    vector<int> a(n + 1);
    int b1 = 0;
    int b2 = 0;
    for (int i = 1; i <= n; i++) {
        cin >> a[i];
    }
    vector<int> b(a);
    sort(a.begin() + 1, a.end());
    for (int i = 1; i <= n; i++) {
        if (b[i] != a[i]) {
            b1 = b[i];
            b2 = a[i];
            break;
        }
    }
    if (b1 < b2) {
        swap(b1, b2);
    }
    if (b1 == 0 && b2 == 0) {
        NO;
        return;
    } else {
        YES;
        cout << 2 << endl;
        cout << b1 << " " << b2 << endl;
    }
}

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    int t = 0;
    cin >> t;
    while (t--) solve();
    return 0;
}